<template>
  <div class="card">
    <moduleHead title="操作记录"></moduleHead>

    <el-table v-if="details.processList && details.processList.length" :data="details.processList" size="mini" style="margin-top: 10px">
      <el-table-column prop="operateName" label="操作名称"></el-table-column>
      <el-table-column prop="processUser" label="操作人"></el-table-column>
      <el-table-column prop="processUser" label="总用时">
        <template slot-scope="{ row }">
          <template v-if="!(row.operateName.indexOf('创建') > -1)">{{ row.costTime | hourMinute }}</template>
        </template>
      </el-table-column>
      <el-table-column prop="createTime" label="操作时间"></el-table-column>
      <el-table-column label="详情" width="80px" align="center">
        <template slot-scope="{ row }">
          <el-button v-if="!hideProcessDetailsBtn(row.operateType)" @click="handleShowProcessDetailsDialog(row)" type="text">查看</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { hourMinute } from "@/utils/filters";

export default {
  name: "ProcessFlow",
  components: {},
  filters: { hourMinute },
  props: {
    details: {
      type: Object,
      default: () => {},
    },
  },
  data() {
    return {};
  },
  computed: {},
  watch: {},
  created() {},
  methods: {
    handleShowProcessDetailsDialog(row) {
      this.$emit("view", row);
    },
    hideProcessDetailsBtn(type) {
      return ["09", "11", "12", "14", "17", "07", "00", "30", "50"].includes(type);
    },
  },
};
</script>
<style lang="less" scoped>
.el-form-item__content {
  div {
    word-break: break-all;
  }
}
</style>
